<?php
$block_data = $this->getBlockData();
$blocks = $block_data['block'];
$banners = $block_data['banners'];
$click_url = $this->getUrl('bannerslider/index/click');
?>
<script type="text/javascript" src="<?php echo $this->getJsUrl('magestore/bannerslider/jquery-1.7.min.js')?>"></script>
<script type="text/javascript" src="<?php echo $this->getJsUrl('magestore/bannerslider/jquery.ads.note.js') ?>"></script>
<script type="text/javascript" src="<?php echo $this->getJsUrl('magestore/bannerslider/slider1/jquery.slider.min.js') ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->getJsUrl('magestore/bannerslider/jquery.ads.note.css') ?>">
<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('css/magestore/bannerslider/slider3.css') ?>">

<script type="text/javascript">
    var jnote = jQuery.noConflict();
    jnote(document).ready(function($) {
        jnote("#ads-note-<?php echo $blocks['bannerslider_id'] ?>").adsNote({
		  bgcolor:"<?php echo $blocks['note_color'] ?>", //23b8ff  
		  position:"<?php echo Mage::helper('bannerslider')->getVaulePosition($blocks['position_note']) ?>"
	  });
        jnote(".slider2-note-<?php echo $blocks['bannerslider_id'] ?>").slideshow({
            width      : 300,
            height     : 200,
            transition : 'square'
        });
    });
</script>
<div id="ads-note-<?php echo $blocks['bannerslider_id'] ?>">
	<div class="ads-note-box" >
        <div class="ads-note-content">
            <div class="ads-note-content-text">
                <?php if(!$blocks['show_title']): ?>
                        <strong><span style="text-transform: uppercase; color: #ffffff; margin-bottom: 1px"><?php echo $blocks['title'] ?></span></strong>
                        <br>
                <?php endif; ?>
                <?php echo $blocks['description'] ?>
            </div>
            <div class="ads-note-content-img">
               <div class="bannerslide-minimal-slider">
                    <div class="slider2-note-<?php echo $blocks['bannerslider_id'] ?>">
                        <?php foreach ($banners as $banner): ?>
                            <div>
                                <a href="<?php echo $banner['click_url']; ?>" onclick="bannerClicks('<?php echo $banner['banner_id']?>','<?php echo $blocks['bannerslider_id'] ?>')" style="display:block;"><img src="<?php echo $this->getBannerImage($banner['image']); ?>" title="<?php echo $banner['name']; ?>" width="300" height="200"/></a>
                            </div>
                        <?php endforeach; ?>    

                    </div>
               </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
        function bannerClicks(id_banner,slider_id){
		var click_url = '<?php echo $click_url;?>';
		banner_id = id_banner;
		new Ajax.Request(click_url,{
			method: 'post',
			parameters:{id_banner: banner_id,slider_id:slider_id},
			onFailure: '',
			onSuccess: ''
			
		});
		
	}
    </script>